package org.linuxsogood.boot.jpa.entity;

import lombok.Data;
import lombok.ToString;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.util.Date;

/**
 * @author honway.liu
 * @date 2019/9/16 10:10 PM
 * @email gm100861@gmail.com
 * @blog http://linuxsogood.org
 */
@Entity
@Table(name = "t_employee")
@Data
@ToString
@EntityListeners(AuditingEntityListener.class)
public class Employee {

    @Id
    @GeneratedValue
    private Integer id;

    @Column(length = 12)
    private String name;

    private Integer age;

    private String address;

    private String email;

    @CreatedDate
    private Date birthday;

    @LastModifiedDate
    private Date updateTime;
}
